<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.io.File"%>
<%@ page import="java.util.UUID"%>

<%@ page import="cn.com.konyo.mis.GenerateFiles"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>生成器</title>
</head>
<body>

<%
	String path = request.getRealPath("");
	String modulename = request.getParameter("modulename");                 
	String modulename_cn = request.getParameter("modulename_cn");
	String generateFileName = UUID.randomUUID().toString();
	String bool = null;
	if(modulename != null && modulename.length() > 0 
			&& modulename_cn != null && modulename_cn.length() > 0){
		GenerateFiles gf = new GenerateFiles();
		bool = gf.init(path,modulename, modulename_cn,generateFileName);
	}
%>

<form action="index.jsp" id="form" name="form" method="get">
	模块代码:<input type="text" id="modulename" name="modulename" value=""/>[KMessage]<br>
	模块名称:<input type="text" id="modulename_cn" name="modulename_cn" value=""/>[系统消息]<br>
	<input type="submit" id="submit" name="submit" value="submit"/><br>
</form>
<%
	if(bool!=null){
			out.println("生成代码成功!");
			out.println("<a href=\"generateFiles/"+bool+"\">下载</a>");
	}else{
		out.println("生成代码失败!");
	}
%>
</body>
</html>